<!DOCTYPE html>
<html>
<head>
	<title>日期(这种方式行不通,不知道为什么)</title>
</head>
<body>
	<input type="date" id="ipt" onchange="ch()">
</body>
	<script type="text/javascript">
		var now = new Date();
		document.getElementById("ipt").value=now;
		function ch(){
			var time = now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate();
			console.log(now.getFullYear());
			console.log(time);
			document.getElementById("ipt").value=time;
		}
		
		
	</script>
</html>